package Y2024.M12.D10;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 25228
 * Date: 2024-12-10
 * Time: 9:57
 */
public class Main {
    public static void main(String[] args) throws InterruptedException {
        ExecutorService pool= Executors.newFixedThreadPool(10);
        Thread thread1=new Thread(new Print1(10));
        Thread thread2=new Thread(new Print2());
        pool.execute(thread1);
        thread2.join();
        pool.execute(thread2);
        pool.shutdown();
    }
}
class Print1 implements Runnable{
    int n;
    Print1(int n){
        this.n=n;
    }
    @Override
    public void run() {
        for (int i = 0; i < n; i++) {
            System.out.println("这是第"+i+"行");
        }
    }
}
class Print2 implements Runnable{

    @Override
    public void run() {
        for (int i = 0; i < 26; i++) {
            char s='a';
            s+=i;
            System.out.println(s);
        }
    }
}